<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="hmg.common.CommonUtils"%>
<%@ page import="hmg.common.ValueHolder"%>
<%@ page import="java.util.List"%>
<%@ page import="hmg.vo.BoardVO"%>
<%@ page import="hmg.vo.FileVO"%>
<%--
    JSP Name : jspName.jsp
    Description : 설명을 기술합니다.
    author Kim hyung soo
    since 2012. 8. 20.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 8. 20.     Kim hyung soo     최초 생성
--%>
<%
    BoardVO news = (BoardVO) request.getAttribute("NewsInfo");
    List<FileVO> attachedList = (List<FileVO>) request.getAttribute("AttachedList");
    BoardVO prevNews = (BoardVO) request.getAttribute("PrevNewsInfo");
    BoardVO nextNews = (BoardVO) request.getAttribute("NextNewsInfo");
    boolean isHTML = false;
    String ogImageURL = "";

    String listID = request.getParameter("listID");
    String currPage = CommonUtils.getParameter(request.getParameter("page"), "1");
    String compType = CommonUtils.getParameter(request.getParameter("compType"), "");

    if (news.getHTMLState().equals("Y") == true)
        isHTML = true;

    ogImageURL = ValueHolder.SERVER_DOMAIN + ValueHolder.DEFAULT_IMAGE_PATH;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ko" xml:lang="ko" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>사실은 이렇습니다 | 현대자동차그룹</title>
<meta name="description" content="현대자동차그룹 및 계열사별 사실은 이렇습니다 게시판" />
<meta name="keywords" content="현대자동차그룹 사실은 이렇습니다, 현대차그룹 사실은 이렇습니다, 공지, 사실은 이렇습니다, Notice" />
<%@ include file="/WEB-INF/jsp/web/kor/include/header.jspf" %>
<script type="text/javascript">

function fn_print_notice() {
    window.open('./RelViewPrint.do?listID=<%= news.getListID() %>','현대자동차그룹공식홈페이지','scrollbars=yes, toolbar=yes, width=740, height=650');
}

</script>
<meta property="og:type"        content="article" />
<meta property="og:url"         content="<%= ValueHolder.SERVER_DOMAIN + request.getAttribute("javax.servlet.forward.request_uri") + "?" + request.getQueryString() %>" />
<meta property="og:title"       content="<%= news.getTitle() %>" />
<meta property="og:description" content="<%= CommonUtils.getPlainText(news.getWebContent(), true, 100) %>" />
<meta property="og:image"       content="<%= ogImageURL %>" />
</head>
<body>
    <!--wrap-->
    <div id="wrap">
        <!-- skip navigation -->
        <div id="skipnavition">
            <a href="#gnb">메뉴바로가기</a><a href="#content">본문바로가기</a>
        </div>
        <!--// skip navigation -->

        <hr />

        <!-- header-->
        <%@ include file="/WEB-INF/jsp/web/kor/include/left.jspf" %>
        <!--//header-->

        <hr />

        <!--container-->
        <div id="container">
            <div class="scroll-pane">
                <!-- 공통 -->
                <div class="subTitle">
                    <div class="pageTitle">
                        <h2><img src="/hmg/images/web/kor/title/group_Real_Notice.gif" alt="사실은 이렇습니다" /></h2>
                        <p class="subCopy"><img src="/hmg/images/web/kor/title/group_Real_list_desc.gif" alt="현대자동차그룹에서 알려 드립니다" /></p>
                    </div>
    
                    <div class="pageLocation">
                        <ul>
                            <li><a href="/hmg/web/kor/Main.do"><img src="/hmg/images/web/kor/common/location_home.gif" alt="홈"/></a></li>
                            <li><a href="/hmg/web/kor/grn/GroupNewsSubMain.do">그룹소식</a></li>
                            <li class="nowPage"><a href="/hmg/web/kor/grn/rel/RelList.do">사실은 이렇습니다</a></li>
                        </ul>
                    </div>
                </div>
                <!--//공통-->

                <!--contents-->
                <div id="content">
                    <!-- 내용 -->
                    <div class="groupNews">
                        <div class="view_Icon">
                            <a href="javascript:fn_share_facebook(document.location, '<%= news.getTitle() %>');"><img src="/hmg/images/web/kor/common/icon_facebook.gif" alt="페이스북" /></a>
                            <a href="javascript:fn_share_twitter(document.location, '<%= news.getTitle() %>');"><img src="/hmg/images/web/kor/common/icon_twitter.gif" alt="트위터" /></a>
                            <a href="javascript:fn_print_notice();"><img src="/hmg/images/web/kor/btn/btn_print.gif" alt="Print" /></a>
                            <a href="#" onclick="javascript:fn_font_size(1);"><img src="/hmg/images/web/kor/btn/text_Sizeup.gif" alt="글자 크게" /></a>
                            <a href="#" onclick="javascript:fn_font_size(-1);"><img src="/hmg/images/web/kor/btn/text_Sizedown.gif" alt="글자 작게" /></a>
                        </div>

                        <div class="view_table01">
                            <table summary="사실은 이렇습니다 보기 테이블">
                                <caption>사실은 이렇습니다 보기</caption>
                                <colgroup>
                                    <col width="12%" /><col width="78%" /><col width="10%" />
                                </colgroup>
                                <tbody>
                                   <tr>
                                        <th colspan="3"><%= news.getTitle() %></th>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><%= news.getCompName() %></td>
                                        <td class="align_right"><%= news.getRegDate() %></td>
                                    </tr>
                                    <tr>
                                        <td colspan="3" class="Notice<%= attachedList != null && attachedList.size() > 0 ? " brd_dash" : "" %>">
                                            <p><%= CommonUtils.getWebText(news.getWebContent(), isHTML) %></p>
                                        </td>
                                    </tr>
<%  if (attachedList != null && attachedList.size() > 0) { %>
                                    <tr>
                                        <th class="downloadFile"><img src="/hmg/images/web/kor/grn/download_Text.gif" alt="첨부파일"/></th>
                                        <td colspan="2" class="last">
<%
        for (int idx = 0; idx < attachedList.size(); idx++) {
            FileVO attached = attachedList.get(idx);

            out.println("                                            <a href=\"/hmg/web/kor/com/DownloadFile.do?fileSeq=" + attached.getFileSeq() + "\">&nbsp;&nbsp;<img src=\"/hmg/images/web/kor/common/icon_Download.gif\" alt=\"첨부파일\" /> " + attached.getOriginalFileName() + "</a><br />");
        }
%>
                                        </td>
                                    </tr>
<%  } %>
                                </tbody>
                            </table>
                        </div>

                        <div class="view_table02">
                            <table summary="사실은 이렇습니다 보기 목록 테이블">
                            <caption>사실은 이렇습니다 보기 목록</caption>
                            <colgroup>
                                <col width="12%" /><col width="88%" />
                            </colgroup>
                            <tbody>
                                <tr>
                                    <th><img src="/hmg/images/web/kor/grn/prevList.gif" alt="이전글"/></th>
                                    <td style="width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">
<%
    if (prevNews != null)
        out.println("                                        <a href=\"./RelView.do?listID=" + prevNews.getListID() + "&compType=" + compType + "&page=" + currPage + "\"> " + prevNews.getTitle() + "</a>");
    else
        out.println("                                        이전 글이 존재하지 않습니다.");
%>
                                    </td>
                                </tr>
                                <tr>
                                    <th class="last"><img src="/hmg/images/web/kor/grn/nextList.gif" alt="다음글"/></th>
                                    <td class="last" style="width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">
<%
    if (nextNews != null)
        out.println("                                        <a href=\"./RelView.do?listID=" + nextNews.getListID() + "&compType=" + compType + "&page=" + currPage + "\"> " + nextNews.getTitle() + "</a>");
    else
        out.println("                                        다음 글이 존재하지 않습니다.");
%>
                                    </td>
                                </tr>
                            </tbody>
                            </table>
                        </div>

                        <div class="btnWrap">
                            <div class="align_right">
                                <a href="./RelList.do?compType=<%= compType %>&page=<%= currPage %>"><img src="/hmg/images/web/kor/btn/btn_list02.gif" alt="목록" /></a>
                            </div>
                        </div>
                    </div>
                    <!--// 내용 -->
                </div>
                <!--//contents-->
            </div>
        </div>
        <!--//container-->

        <hr />

        <!--footer-->
        <%@ include file="/WEB-INF/jsp/web/kor/include/footer.jspf" %>
        <!--//footer-->

        <hr />

        <!--notice-->
        <%@ include file="/WEB-INF/jsp/web/kor/include/notice.jspf" %>
        <!--//notice-->
    </div>
    <!--//wrap-->
</body>
</html>